package com.sky.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sky.dto.EmployeeDTO;
import com.sky.vo.EmployeeVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Employee implements Serializable, Cloneable{

    private static final long serialVersionUID = 1L;

    private Long id;


    private String username;

    private String name;

    private String password;

    private String phone;

    private String sex;

    private String idNumber;

    private Integer status;

    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss")
    private LocalDateTime updateTime;

    private Long createUser;

    private Long updateUser;

    @Override
    public EmployeeVO clone() throws CloneNotSupportedException {
        EmployeeVO employeeVO = new EmployeeVO();
        BeanUtils.copyProperties(this,employeeVO);

        return employeeVO;
    }
}
